import 'package:flutter/material.dart';
import 'package:flutter/services.dart';


class FlexLayoutPage extends StatelessWidget {
  final SystemUiOverlayStyle _style = SystemUiOverlayStyle(statusBarColor: Colors.transparent);
  @override
  Widget build(BuildContext context) {
    SystemChrome.setSystemUIOverlayStyle(_style);
    // TODO: implement build
    return MaterialApp(
      home: FlexWidget(),
      theme: ThemeData(primarySwatch: Colors.yellow),
    );
  }
}

class FlexWidget extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _FlexPage();
  }
}

class _FlexPage extends State<StatefulWidget> {

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text("Flex Page"),
      ),
      body: Flex(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Container(
              width: 50,
              color: Colors.green,
            ),
            Expanded(
              flex: 1,
              child: Container(
                height: 120,
                color: Colors.red,
              ),
            ),

            Expanded(
              flex: 1,
              child: Container(
                height: 120,
                color: Colors.blue,
              ),
            ),


            Expanded(
              flex: 1,
              child: Container(
                height: 120,
                color: Colors.yellow,
              ),
            ),
          ],
          direction: Axis.horizontal),
    );
  }
}